<template>      
    <!-- <div class="person">
        <h2>{{ list }}</h2>
        <ul>
            <li v-for="item in list" :key="item.id">{{ item.name }}</li>
        </ul>
    </div> -->
</template>

<script lang="ts"  setup >
   // import  {type Persons } from '@/types';
    //import {defineProps,withDefaults} from 'vue'

    // 接收list
    // defineProps(['list'])

    //接收list，同时将props保存起来
    //let x = defineProps(['list'])
    //console.log(x.list)

    //接收list+限制类型
    // defineProps<{list:Persons}>()

    //接收list+限制类型+限制必要性+指定默认值
    // withDefaults(defineProps<{list?:Persons}>(),{
    //     list:()=>[{id:'0000',name:'康师傅',age:19}]
    // })
</script> 